home *** CD-ROM | disk | FTP | other *** search
- /*****
- *
- * DebugUtil.c
- *
- * For those of you unfamilliar with assertions, run - don't walk -
- * to get a copy of "Code Complete" by Steve McDonnell(sp?)
- *
- * This is a support file for "Grant's CGI Framework".
- * Please see the license agreement that accompanies the distribution package
- * for licensing details.
- *
- * Copyright ©1995,1996 by Grant Neufeld
- * grant@acm.com
- * http://arpp.carleton.ca/grant/
- *
- *****/
-
- #include <ConditionalMacros.h>
-
- #include "MyConfiguration.h"
-
- #include "compiler_stuff.h"
-
- #include "LogUtil.h"
-
- #include "DebugUtil.h"
-
-
- /*** FUNCTIONS ***/
-
- /* if the assertion (passed) fails, display the string in the debugger to alert
- the developer to an unexpected problem in the code.
- theString must be a Pascal format string (IE. "\p").
- If an assertion ever occurs, you know that one of two things has occurred:
- - something you never expected to happen in your function, happened
- - you made an incorrect assumption about what state things could be in
- prior to your function being called */
- #if kCompileWithAssertions
- p_export
- void
- my_assert ( Boolean passed, const StringPtr theString )
- {
- if ( !passed )
- {
- LogStringDebugP ( theString );
-
- #if GENERATINGPOWERPC
- DebugStr ( theString );
- #else
- SysBreakStr ( theString );
- #endif
- }
- } /* my_assert */
- #endif
-
-
- /*** EOF ***/
-